<extend name="./public/frame.html"/>
<block name="content">
    <form class="layui-form" action="{:url('edit')}" method="post" enctype="multipart/form-data">
        <table class="layui-table">
            <tr>
                <td>姓名</td>
                <td>{$info['cus_name']}</td>
            </tr>
            <tr>
                <td>归属路线</td>
                <td>
                    <select name="blong_route" class="layui-input" lay-filter="blong_route" lay-verify="required">
                        <if condition="$info['blong_route']">
                            <option value="{$info['blong_route']}">{$info['blong_route_info']}</option>
                        </if>
                        <option value="">--请选择起始区域--</option>
                        <volist name="route_list" id="vo">
                            <option value="{$vo['start_address']}_{$vo['end_address']}">{$vo['start_name']} 至 {$vo['end_name']}</option>
                        </volist>
                    </select>
                </td>
            </tr>
            <tr>
                <td>手机号</td>
                <td>
                    <input name="cus_phone" type="text" class="layui-input" lay-verify="number|phone" maxlength="11" value="{$info['cus_phone']}" placeholder="用于接收下单短信的工作号"/>
                </td>
            </tr>
            <tr>
                <td>微信号</td>
                <td>
                    <input name="wx_account" type="text" class="layui-input" value="{$info['wx_accout']}" placeholder="用于绑定模板消息的微信号"/>
                </td>
            </tr>
            <!--<tr>
                <td>是否启用</td>
                <td colspan="3">
                    <input type="text" id="" name="is_use" value="1" hidden>
                    <input type="checkbox" checked lay-skin="switch" lay-filter="switch" lay-text="是|否">
                </td>
            </tr>-->
        </table>
        <input type="hidden" name="id" value="{$info['id']}" />
        <button class="layui-btn" lay-submit="" lay-filter="submit">提交</button>
        <!--<button type="reset" class="layui-btn layui-btn-primary">重置</button>-->
    </form>
    <script>
        layui.use(['form'], function () {
            var form = layui.form;
            //监听开关
            form.on('switch(switch)', function (data) {
                $(data.elem).prev('input').val(2);
                if (data.elem.checked) {
                    $(data.elem).prev('input').val(1);
                }
            });

            //监听提交
            form.on('submit(submit)', function (data) {

            });
        });
    </script>
</block>